package com.spring.housing1.controller.others;


import com.google.zxing.WriterException;
import com.spring.housing1.constant.isNull;
import com.spring.housing1.returnType.CommenResult;
import com.spring.housing1.server.ExecutorServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Map;

@Controller
public class RestContoller {

    @Autowired
    ExecutorServer loginServer;
/**
* 获取二维码
* */
    @ResponseBody
    @isNull({"open_id","identify_id"})
    @GetMapping(value = "/getImage")
    public CommenResult getImage(@RequestParam Map<String,String> param) throws Exception {

        return new CommenResult<>(200,"获取二维码成功!",loginServer.getCodeImages(param));

    }
}
